IQuaternaryDictionary.TryAdd(TKey, TValue) method¶
Defined in
Type: IQuaternaryDictionaryReactiveList.Reactive.Collections
Assembly: ReactiveList.Reactive.dll
Applies to
net11.0, net10.0, net47, net471, net472, net48, net481
bool TryAdd(TKey key, TValue value)
Summary: Attempts to add the specified key and value to the collection.
Parameters
| Name | Type | Description |
|---|---|---|
key | TKey | The key of the element to add. Cannot be null if null keys are not supported by the implementation. |
value | TValue | The value of the element to add. |
Returns: bool (opens in a new tab) -- true if the key and value were added successfully; otherwise, false. Returns false if an element with the same key already exists.
Remarks
This method does not throw an exception if the key already exists in the collection. The behavior when adding a duplicate key depends on the implementation.